﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ExcellentCRM.DataService.Models
{
    /// <summary>
    /// 员工表
    /// </summary>
    [Table("Staff")]
    public class Staff : BaseModel
    {
        [Display(Name = "所属部门")]
        public long DeptId { get; set; }

        public long AcctId { get; set; }

        [Display(Name = "姓名")]
        [Required(AllowEmptyStrings = false)]
        [StringLength(30)]
        public string StaffName { get; set; }

        [Display(Name = "电话")]
        [StringLength(20)]
        public string Phone { get; set; }

        [Display(Name = "邮箱")]
        [StringLength(100)]
        public string Email { get; set; }

        [ForeignKey("DeptId")]
        public virtual Department Department { get; set; }

        [ForeignKey("AcctId")]
        public Account Account { get; set; }

        [InverseProperty("CreatedByStaff")]
        public virtual IList<Remind> CreatedReminds { get; set; }

        [InverseProperty("RemindTarget")]
        public virtual IList<Remind> Reminds { get; set; }

        public virtual IList<ContactRecord> ContactRecords { get; set; } 
    }
}